export default {
    setdata(state, data) {
        state.name = data
    },

    delTimer(state, data) {
        console.log("delTimer")
        clearTimeout(state.timer)
    },

    startTimer(state, data) {
        console.log("startTimer")
        // 新添加一个方法，会跳转到page 时区页面
        let time1 = 0;
        let sleep = 200 * 2 * 60 * 1000
        state.timer = setTimeout(() => {

            let time2 = Date.now()
            if (time2 - time1 > sleep) {
                alert("跳转到page")
                clearTimeout(state.timer)
            }
        }, sleep)
    },

    restartTimer(state, data) {
        console.log("restartTimer")
        // 新添加一个方法，会跳转到page 时区页面
        let time1 = 0;
        let sleep = 200 * 2 * 60 * 1000
        clearTimeout(state.timer)
        state.timer = setTimeout(() => {

            let time2 = Date.now()
            if (time2 - time1 > sleep) {
                alert("跳转到page")
            }
        }, sleep)
    }
}